#!/bin/bash
#@Version 104
#@SupressWarning maximum tests number 999

./testgen
for i in ???
do
        mv $i $i.in
done
mv sol.in sol
for((i = 1; i < 10; i++))
do
	if(test -e ./00$i.in)
	then
		echo Test $i:
		./valid <00$i.in
		./sol <00$i.in >00$i.out
		./check 00$i.in 00$i.out 00$i.out
	else
		break
	fi
done
for((i = 10; i < 100; i++))
do
	if(test -e ./0$i.in)
	then
		echo Test $i:
		./valid <0$i.in
		./sol <0$i.in >0$i.out
		./check 0$i.in 0$i.out 0$i.out
	else
		break
	fi
done
for((i = 100; i < 1000; i++))
do
        if(test -e ./$i.in)
        then
                echo Test $i:
                ./valid <$i.in
                ./sol <$i.in >$i.out
                ./check $i.in $i.out $i.out
        else
                break
        fi
done

